home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / Bonus / VCLZip / kp222_b5.exe / kpCntn.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-23  |  6.2 KB  |  172 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1999 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'kpCntn.pas' rev: 5.00
  6.  
  7. #ifndef kpCntnHPP
  8. #define kpCntnHPP
  9.  
  10. #pragma delphiheader begin
  11. #pragma option push -w-
  12. #pragma option push -Vx
  13. #include <SysUtils.hpp>    // Pascal unit
  14. #include <Classes.hpp>    // Pascal unit
  15. #include <Windows.hpp>    // Pascal unit
  16. #include <SysInit.hpp>    // Pascal unit
  17. #include <System.hpp>    // Pascal unit
  18.  
  19. //-- user supplied -----------------------------------------------------------
  20.  
  21. namespace Kpcntn
  22. {
  23. //-- type declarations -------------------------------------------------------
  24. typedef int tOLSize;
  25.  
  26. typedef void *TObjects[536870911];
  27.  
  28. typedef void * *pObjects;
  29.  
  30. class DELPHICLASS TObjectList;
  31. class PASCALIMPLEMENTATION TObjectList : public Classes::TPersistent 
  32. {
  33.     typedef Classes::TPersistent inherited;
  34.     
  35. private:
  36.     bool FDestroy;
  37.     void * *FList;
  38.     int FCount;
  39.     int FCapacity;
  40.     
  41. protected:
  42.     virtual void __fastcall Error(void);
  43.     virtual void __fastcall Grow(void);
  44.     virtual void __fastcall Put(int Index, System::TObject* Item);
  45.     System::TObject* __fastcall Get(int Index);
  46.     void __fastcall SetCapacity(int NewCapacity);
  47.     void __fastcall SetCount(int NewCount);
  48.     void * __fastcall Allocate(int Size);
  49.     virtual void __fastcall FreeItem(void * AnItem);
  50.     
  51. public:
  52.     __fastcall TObjectList(void);
  53.     __fastcall TObjectList(bool DestroyObjects, int InitialCapacity);
  54.     __fastcall virtual ~TObjectList(void);
  55.     virtual int __fastcall AddObject(System::TObject* Item);
  56.     virtual void __fastcall Clear(void);
  57.     void __fastcall Delete(int Index);
  58.     void __fastcall DeleteAll(void);
  59.     void __fastcall FreeAll(void);
  60.     void __fastcall FreeAt(int Index);
  61.     void __fastcall FreeObject(System::TObject* Item);
  62.     virtual int __fastcall IndexOf(System::TObject* Item);
  63.     virtual void __fastcall Insert(int Index, System::TObject* Item);
  64.     void __fastcall Move(int CurIndex, int NewIndex);
  65.     void __fastcall Pack(void);
  66.     __fastcall TObjectList(const AnsiString FileName);
  67.     void __fastcall SaveToStream(const AnsiString FileName);
  68.     void __fastcall LoadFromStream(const AnsiString FileName);
  69.     virtual void __fastcall ReadData(Classes::TStream* S);
  70.     virtual void __fastcall WriteData(Classes::TStream* S);
  71.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  72.     virtual System::TObject* __fastcall First(void);
  73.     virtual System::TObject* __fastcall Last(void);
  74.     virtual System::TObject* __fastcall Next(System::TObject* Item, bool Forward);
  75.     void __fastcall ForEach(void * Action);
  76.     System::TObject* __fastcall LastThat(void * Test);
  77.     System::TObject* __fastcall FirstThat(void * Test);
  78.     __property int Capacity = {read=FCapacity, write=SetCapacity, nodefault};
  79.     __property System::TObject* Items[int Index] = {read=Get, write=Put/*, default*/};
  80.     __property int Count = {read=FCount, nodefault};
  81.     __property bool DestroyObjects = {read=FDestroy, write=FDestroy, nodefault};
  82. };
  83.  
  84.  
  85. class DELPHICLASS TAbsMemStream;
  86. class PASCALIMPLEMENTATION TAbsMemStream : public Classes::TStream 
  87. {
  88.     typedef Classes::TStream inherited;
  89.     
  90. private:
  91.     void *FMemory;
  92.     int FSize;
  93.     int FPosition;
  94.     
  95. public:
  96.     __fastcall TAbsMemStream(void * UseBuf, int MaxSize);
  97.     virtual int __fastcall Read(void *Buffer, int Count);
  98.     virtual int __fastcall Write(const void *Buffer, int Count);
  99.     virtual int __fastcall Seek(int Offset, Word Origin);
  100.     __property int Position = {read=FPosition, nodefault};
  101.     __property void * Memory = {read=FMemory};
  102.     __property int Size = {read=FSize, nodefault};
  103. public:
  104.     #pragma option push -w-inl
  105.     /* TObject.Destroy */ inline __fastcall virtual ~TAbsMemStream(void) { }
  106.     #pragma option pop
  107.     
  108. };
  109.  
  110.  
  111. class DELPHICLASS TSortedObjectList;
  112. class PASCALIMPLEMENTATION TSortedObjectList : public TObjectList 
  113. {
  114.     typedef TObjectList inherited;
  115.     
  116. private:
  117.     Classes::TDuplicates FDuplicates;
  118.     
  119. protected:
  120.     virtual void * __fastcall KeyOf(System::TObject* Item);
  121.     virtual void __fastcall Put(int Index, System::TObject* Item);
  122.     
  123. public:
  124.     __fastcall TSortedObjectList(Classes::TDuplicates WithDuplicates);
  125.     virtual void __fastcall ReadData(Classes::TStream* S);
  126.     virtual void __fastcall WriteData(Classes::TStream* S);
  127.     virtual int __fastcall Compare(void * Key1, void * Key2) = 0 ;
  128.     virtual int __fastcall AddObject(System::TObject* Item);
  129.     virtual bool __fastcall Search(void * Key, int &Index);
  130.     virtual void __fastcall Insert(int Index, System::TObject* Item);
  131.     virtual int __fastcall IndexOf(System::TObject* Item);
  132.     __property System::TObject* Items[int Index] = {read=Get};
  133.     __property Classes::TDuplicates Duplicates = {read=FDuplicates, nodefault};
  134. public:
  135.     #pragma option push -w-inl
  136.     /* TObjectList.CreateWithOptions */ inline __fastcall TSortedObjectList(bool DestroyObjects, int InitialCapacity
  137.         ) : TObjectList(DestroyObjects, InitialCapacity) { }
  138.     #pragma option pop
  139.     #pragma option push -w-inl
  140.     /* TObjectList.Destroy */ inline __fastcall virtual ~TSortedObjectList(void) { }
  141.     #pragma option pop
  142.     #pragma option push -w-inl
  143.     /* TObjectList.CreateFromStream */ inline __fastcall TSortedObjectList(const AnsiString FileName) : 
  144.         TObjectList(FileName) { }
  145.     #pragma option pop
  146.     
  147. };
  148.  
  149.  
  150. //-- var, const, procedure ---------------------------------------------------
  151. static const int cMaxList = 0x1fffffff;
  152. extern PACKAGE void __fastcall DoRegisterClass(const void * LoadProc, const void * StoreProc, TMetaClass* 
  153.     Sender);
  154. extern PACKAGE bool __fastcall IsRegistered(TMetaClass* AClass);
  155. extern PACKAGE System::TObject* __fastcall CopyOf(System::TObject* Source);
  156. extern PACKAGE System::TObject* __fastcall ReadObjectFromStream(Classes::TStream* S);
  157. extern PACKAGE void __fastcall WriteObjectToStream(System::TObject* Source, Classes::TStream* S);
  158. extern PACKAGE Word __fastcall RegisterClipBoardType(const AnsiString TypeName);
  159. extern PACKAGE bool __fastcall CopyObjectToClipboard(Word ClipType, System::TObject* Source);
  160. extern PACKAGE System::TObject* __fastcall PasteObjectFromClipboard(Word ClipType);
  161.  
  162. }    /* namespace Kpcntn */
  163. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  164. using namespace Kpcntn;
  165. #endif
  166. #pragma option pop    // -w-
  167. #pragma option pop    // -Vx
  168.  
  169. #pragma delphiheader end.
  170. //-- end unit ----------------------------------------------------------------
  171. #endif    // kpCntn
  172.